class FollowCategory {
  final String id;
  final String name;
  final String color;
  final bool isDefault;
  final DateTime createdAt;

  FollowCategory({
    required this.id,
    required this.name,
    required this.color,
    this.isDefault = false,
    required this.createdAt,
  });

  factory FollowCategory.fromJson(Map<String, dynamic> json) {
    return FollowCategory(
      id: json['id'],
      name: json['name'],
      color: json['color'],
      isDefault: json['isDefault'] ?? false,
      createdAt: DateTime.parse(json['createdAt']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'name': name,
      'color': color,
      'isDefault': isDefault,
      'createdAt': createdAt.toIso8601String(),
    };
  }
}

class FollowedUser {
  final String userId;
  final String username;
  final String avatar;
  final String categoryId;
  final DateTime followedAt;

  FollowedUser({
    required this.userId,
    required this.username,
    required this.avatar,
    required this.categoryId,
    required this.followedAt,
  });

  factory FollowedUser.fromJson(Map<String, dynamic> json) {
    return FollowedUser(
      userId: json['userId'],
      username: json['username'],
      avatar: json['avatar'],
      categoryId: json['categoryId'],
      followedAt: DateTime.parse(json['followedAt']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'userId': userId,
      'username': username,
      'avatar': avatar,
      'categoryId': categoryId,
      'followedAt': followedAt.toIso8601String(),
    };
  }
}
